package com.athenaeum.datastore.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.athenaeum.datastore.domain.Organization;
import com.athenaeum.datastore.repository.OrganizationRepository;
import com.athenaeum.datastore.service.OrganizationService;

@Service
public class OrganizationServiceImpl implements OrganizationService {

	@Resource
	private OrganizationRepository organizationRepository;

	@Override
	@Transactional(readOnly = true)
	public Iterable<Organization> findAll() {
		return organizationRepository.findAll();
	}

	@Override
	@Transactional(readOnly = true)
	public Organization findOne(String organizationId) {
		return organizationRepository.findOne(organizationId);
	}

	@Override
	public void delete(String organizationId) {
		organizationRepository.delete(organizationId);
	}

	@Override
	public Organization save(Organization organization) {
		return organizationRepository.save(organization);
	}

}
